<div id="best-group">
	<h1>
		<span>推荐团购：</span><a href="$best_group[url]" target="blank">$best_group[name]</a>
	</h1>
	<div class="deal-box">
		<div class="deal-info">
			<div class="deal-discount">
				原价：<b>$best_group[market_price_format]</b>&nbsp;&nbsp;&nbsp;折扣：<b>$best_group[discount]折</b>
			</div>
			<div class="deal-buy">
				<p>
					<strong>{echo floatval($best_group['shop_price'])}</strong>
					<a href="$best_group[go_url]"><img src="{TPL_PATH}images/buy.gif"></a>
				</p>
			</div>
			<div class="deal-timeleft">
				<h3>剩余时间</h3>
				<div class="best_end_time" endTime="$best_group[end_time]"></div>
			</div>
			<div class="deal-status">
				<p>目前&nbsp;<strong>$best_group[bought]</strong>&nbsp;人已购买</p>
			</div>
		</div>
		<div class="deal-img">
			<a href="$best_group[url]" target="blank"><img src="$best_group[big_img]" width="475" /></a>
		</div>
	</div>
</div>
<div class="blank9"></div>
<script type="text/javascript">
function updateBestEndTime()
{
	var date = new Date();
	var time = date.getTime();
	
	$(".best_end_time").each(function(i){
		var endDate =new Date(this.getAttribute("endTime"));
		var endTime = endDate.getTime();
		var lag = (endTime - time) / 1000;
		
		var second = Math.floor(lag % 60);     
		var minite = Math.floor((lag / 60) % 60);
		var hour = Math.floor((lag / 3600) % 24);
		var day = Math.floor((lag / 3600) / 24);
		$(this).html("<span class='d'>"+day+"</span><span class='h'>"+hour+"</span><span class='m'>"+minite+"</span><span class='s'>"+second+"</span>");
	});
	
	setTimeout("updateBestEndTime()",1000);
}

jQuery(function($){
	updateBestEndTime();
});
</script>
